
const warehouseDeptId = 79434533

function getFields(data) {
  const date = new Date(data.createTime)
  const fields = [
    {
      name: '应出勤天数',
      field: 'shouldAttendanceDays',
      formType: 'number',
      setting: []
    },
    {
      name: '实际出勤天数',
      field: 'realAttendanceDays',
      formType: 'number',
      setting: []
    },
    {
      name: '年假（天）',
      field: 'leaveYear',
      formType: 'number',
      setting: []
    },
    {
      name: '加班（天）',
      field: 'workOvertime',
      formType: 'number',
      setting: []
    },
    {
      name: '调休（天）',
      field: 'leavePaid',
      formType: 'number',
      setting: []
    },
    {
      name: '事假（天）',
      field: 'leaveThing',
      formType: 'number',
      setting: []
    },
    {
      name: '迟到/早退（次）',
      field: 'lateArrivalTimes',
      formType: 'number',
      setting: []
    },
    {
      name: '迟到/早退（分钟）',
      field: 'lateArrivalDeductions',
      formType: 'number',
      setting: []
    },
    {
      name: '迟到/早退（扣款）',
      field: 'lateArrivalDeductions',
      formType: 'number',
      setting: []
    },
    {
      name: '缺卡次数',
      field: 'lackAttendance',
      formType: 'number',
      setting: []
    },
    {
      name: '缺卡扣款',
      field: 'lackAttendanceDeductions',
      formType: 'number',
      setting: []
    },
    {
      name: '全勤奖',
      field: 'perfectAttendanceReward',
      formType: 'number',
      setting: []
    },
    {
      name: '3月前存休',
      field: 'threeMonthVacation',
      formType: 'number',
      setting: []
    },
    {
      name: '年假存休',
      field: 'yearVacation',
      formType: 'number',
      setting: []
    },
    {
      name: (date.getMonth() - 2) == -1 ? 11 : (date.getMonth() - 2) + '月存休',
      field: 'twoMonthVacation',
      formType: 'number',
      setting: []
    },
    {
      name: (date.getMonth() - 1) == 0 ? 12 : (date.getMonth() - 1) + '月存休',
      field: 'lastMonthVacation',
      formType: 'number',
      setting: []
    },
    {
      name: date.getMonth() + '月存休',
      field: 'thisMonthVacation',
      formType: 'number',
      setting: []
    },
    {
      name: '备注',
      field: 'thisMonthVacation',
      formType: 'textarea',
      maxlength: 100,
      setting: []
    }
  ]
  // 仓储部特有加班费
  if (data.dingtalkDeptId === warehouseDeptId) {
    fields.push(
      {
        name: '加班时长（小时）',
        field: 'workOvertimeHours',
        formType: 'number',
        setting: []
      },
      {
        name: '加班费（元）',
        field: 'workOvertimePay',
        formType: 'number',
        setting: []
      })
  }
  return fields
}

export default {
  warehouseDeptId,
  getFields
}
